{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Exercise 8.2 (Page 5) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAD8CAYAAACfF6SlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xl4VOX9/vH3h7AE2URAEMKmIPuWTDZ3rVa0VaxbQRZtbfnJ5lYXrFar1bpVq5ZFKbUKKIhLFf2iKC61IoGENRC2sIfIFgh7IMvz+yOjHdMAgUzmzGTu13XlYs45z8y5czLcOTkzeWLOOUREJLrU8DqAiIiEnspfRCQKqfxFRKKQyl9EJAqp/EVEopDKX0QkCqn8RUSikMpfRCQKqfxFRKJQTa8DHE3Tpk1du3btvI4hIhJRFixYsNM51+x448K2/Nu1a0dGRobXMUREIoqZbazIOF32ERGJQip/EZEopPIXEYlCQbnmb2Z9gReBGGCic+6pcsbcCPwRcMAS59xNJ7qfwsJCcnJyKCgoqGTiyBAbG0tcXBy1atXyOoqIVDOVLn8ziwHGApcBOUC6mc1wzmUFjOkIPACc65zbbWann8y+cnJyaNCgAe3atcPMKhs9rDnnyMvLIycnh/bt23sdR0SqmWBc9kkCsp1z65xzR4BpQL8yY34LjHXO7QZwzm0/mR0VFBTQpEmTal/8AGZGkyZNouanHBEJrWCUfytgc8Byjn9doLOBs81sjpml+S8TnZRoKP7vRdPnKiKhFYzyL6+hyv5tyJpAR+AiYAAw0cxO/Z8HMhtqZhlmlrFjx44gRBMRiSyLP3uT+e++UOX7CUb55wCtA5bjgNxyxnzgnCt0zq0HVlH6zeBHnHMTnHM+55yvWbPj/oKaJ+rXrw9Abm4u119//Uk/zpgxY+jQoQNmx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mflV9vKYC3wGFlJ5p3QrcBtzm327AWH/uTMAXouN1vFwTgd0Bz68M//oz/cdqif/r/GCIc40MeH6lEfDNqbznQKhy+cfcQumbQALvV9XH6zxKL9UsDfhaXenFc0y/4SsiEoUi7Zq/iIgEgcpfRCQKqfxFRKKQyl9EJAqp/EVEopDKX0QkCqn8RUSikMpfRCQK/X+N/UXGzauRnQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "w = np.array([1.2, -3.2])\n",
    "b = -0.5\n",
    "w1 = w / 0.5\n",
    "b1 = b / 0.5\n",
    "\n",
    "x = np.array([0, 2])\n",
    "y = - (w[0] * x + b) / w[1]\n",
    "y1 = -(w1[0] * x + b1) / w1[1]\n",
    "\n",
    "plt.plot(x, y, label='line1')\n",
    "plt.plot(x, y1, label='line2')\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Exercise 8.6 (Page 12)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAD8CAYAAACcjGjIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAGWFJREFUeJzt3XGMnPV95/H3p2aN91RqG+wktteOnZ7LhYJlV3PQCqmlGMdOVLAvR12ootoRnHURFKm5WsGiIshJrqTo5B46ro2bUDtRD3By1CwXoj1i8OXUxtTL2bExyMVx0ni8vrA12PcHCyzme3/MszDemdmd3efZeeaZ/byk0czze37PM988Mf74+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8xLE/8tLZH0vKRDyX9Pn8qjzlaS9Kik1yS91GC9JD2cHLMjkn5t3J1GhF9T/AJmAD8GPgbMBH4EXDWqz28D/yL5/DngibzrbofjkvS7jMpvhhwASnnX3Q7HBVgOHALmJssfyrvuNjo2O4HPJZ+vAn6ad90tOC6/Cfwa8FKD9Z8Cvkflgae/Drww3j595tAa7/+mRUS8AzwOrK/uEBHPR8SbyeIBKg8i7HTjHpfEl4A/A95qZXE5aua4/DvgkYh4AyAiXmtxjXlp5tgE8EvJ59mM8UDPThERPwBeH6PLeuCbUXGAykNPF4y1T4dDazT6TYtG7qCS8p1u3OMiaRWwOCL+RysLy1kzf15+BfgVSX8n6YCkdS2rLl/NHJsHgM8kz317BvjD1pTW1ib6d1C6X4KzpjX92xWSPgOUgN+a0oraw5jHRdIvADuAza0qqE008+flEipDSzdQOcv835KujohzU1xb3po5NrcDuyLiP0n6DeBbybF5b+rLa1sT+v0c8JlDqzT6TYuLSLoJuA+4JSLeblFteRrvuFwGXA3sl/RTKmOlvdPgonQzf17KwFMRMRwRPwGOUwmLTtfMsbkD2AMQET8EZlF5vtB01tTfQdUcDq1R9zctqjskwydfoxIM02X8eMzjEhHnI2JeRCyNiKVUrsXcEhGd/kjecf+8AHupTGJA0jwqw0wnW1plPpo5Nj8DVgNI+jiVcBhsaZXtpxf4g2TW0q8D5yPizFgbeFipBSLiXUkjv2kxA3g0Io5J2g70R0Qv8BDwi8C3JQH8LCJuya3oFmjyuEw7TR6XPuATkl4GLgBbI+JsflW3RpPH5j8AfyXpj6gMnWyOZMpOp5L0GJUhxnnJtZYvAl0AEfGXVK69fAo4AbwJfHbcfXb4MTMzs0nwsJKZmdVwOJiZWQ2Hg5mZ1XA4mJlZDYeDmZnVcDiYmVkNh4OZmdVwOJiZWY3/D3rNfqdyTg9sAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn import svm\n",
    "from sklearn.linear_model import Perceptron\n",
    "import warnings\n",
    "warnings.filterwarnings(\"ignore\")\n",
    "\n",
    "####(a)\n",
    "####作图\n",
    "N = 20\n",
    "x1 = np.random.uniform(0, 1, N)\n",
    "x2 = np.random.uniform(-1, 1, N)\n",
    "X = np.c_[x1, x2]\n",
    "y = np.sign(x2)\n",
    "\n",
    "plt.scatter(x1[y>0], x2[y>0], label=\"+\")\n",
    "plt.scatter(x1[y<0], x2[y<0], label=\"-\")\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAD8CAYAAABzTgP2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAH9VJREFUeJzt3X+QHGW97/H3l7DJrgr5DSRZYsI1RrmQ2uAIXjmFkRCDlpIcDycGyzJ4oVJ64VB1LClJYXGoHLlGqbrcQ0mpOYpB77lA5CAuV6wIgegfRzhZLjHhR8XE6LnZ7JKEhAQkm7AJ3/tH92R7Znt2Zrd7Zrp3P6+qqZl++unub3on/Z1++umnzd0REREpOqPZAYiISLYoMYiISAklBhERKaHEICIiJZQYRESkhBKDiIiUUGIQEZESSgwiIlJCiUFEREqcmcZKzOx+4NPAAXe/KGa+Af8EfAo4Blzv7v83nLcK+EZY9Zvu/kC17U2bNs3nzJmTRugiImPG888//5q7T69WL5XEAGwAvgv8pML8TwLzwtdlwPeAy8xsCvAPQAFw4Hkz63T314fa2Jw5c+jq6kopdBGRscHM/qOWeqk0Jbn7b4HDQ1RZBvzEA88Ck8xsBrAUeNLdD4fJ4Eng6jRiE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mZ0JTCRoHqhl2XrGhZldRZBsP+buJ4rlFf6maRzoqsbl7ocik/9M8Az44rKLypbdkkJMNcUVsRK4KVpQx/1VTaW467KvxnJTUjOeE9EZrq+W9Q5q2wwPjsV2/eVAbA+GesRlZpOLTTFmNg24HHi52fsr/Nv9nKD99Wdl89LcX7HflyHivRZ4Otw/ncBKC3otzQXmAf+eIJZhxWVmC4EfANe4+4FIeezftIFxzYhMXkMwLD8EZ8mfCOObDHyC0jPnusYVxjaf4GLu7yJl9dxf1XQCXwx7J30EOBr+8KnPvqrHFfZmv4C/JsikJ4D9wKawfCbwRKTep4A/EGT82yPlFxD8x90N/AyYkFJcU4HNwK7wfUpYXgB+GKk3B9gHnFG2/NPADoID3P8C3tOouICPhtv+ffh+Qxb2F/AFoB/YFnl11GN/xX1fCJqmrgk/t4b//t3h/rggsuzt4XI7gU+m/H2vFtdT4f+D4v7prPY3bVBc3wJeCrf/DPCByLL/NdyPu4EvNTKucPpOYF3ZcnXbXwQ/AnvD73I3wbWgLwNfDucbcF8Y8w4ivS3rsa9057OIiJQYy01JIiISQ4lBRERKKDGIiEgJJQYRESmhxCAiIiWUGEREpIQSg4iIlFBiEBGREv8f5f81lj/vM5sAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "margin = 0.09612367161991067\n"
     ]
    }
   ],
   "source": [
    "####训练数据\n",
    "clf = svm.SVC(kernel ='linear', C=1e10)\n",
    "clf.fit(X, y)\n",
    "\n",
    "#获得超平面\n",
    "w = clf.coef_[0]\n",
    "b = clf.intercept_[0]\n",
    "\n",
    "#作图\n",
    "m = np.array([-1, 1])\n",
    "n = - (b + w[0] * m) / w[1]\n",
    "plt.scatter(x1[y>0], x2[y>0], label=\"+\")\n",
    "plt.scatter(x1[y<0], x2[y<0], label=\"-\")\n",
    "plt.plot(m, n, 'r')\n",
    "plt.legend()\n",
    "plt.show()\n",
    "\n",
    "#计算margin\n",
    "margin = 1 / np.sqrt(np.sum(clf.coef_ ** 2))\n",
    "print(\"margin =\",margin)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.0183\n"
     ]
    }
   ],
   "source": [
    "#计算Eout\n",
    "def Eout(w, b, N=10000):\n",
    "    x1 = np.random.uniform(0, 1, N)\n",
    "    x2 = np.random.uniform(-1, 1, N)\n",
    "    X = np.c_[x1, x2]\n",
    "    y = np.sign(x2)\n",
    "    y1 = np.sign(X.dot(w) + b)\n",
    "    return np.mean(y != y1)\n",
    "\n",
    "e = Eout(w, b)\n",
    "print(e)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAD8CAYAAABzTgP2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAH9VJREFUeJzt3X+QHGW97/H3l7DJrgr5DSRZYsI1RrmQ2uAIXjmFkRCDlpIcDycGyzJ4oVJ64VB1LClJYXGoHLlGqbrcQ0mpOYpB77lA5CAuV6wIgegfRzhZLjHhR8XE6LnZ7JKEhAQkm7AJ3/tH92R7Znt2Zrd7Zrp3P6+qqZl++unub3on/Z1++umnzd0REREpOqPZAYiISLYoMYiISAklBhERKaHEICIiJZQYRESkhBKDiIiUUGIQEZESSgwiIlJCiUFEREqcmcZKzOx+4NPAAXe/KGa+Af8EfAo4Blzv7v83nLcK+EZY9Zvu/kC17U2bNs3nzJmTRugiImPG888//5q7T69WL5XEAGwAvgv8pML8TwLzwtdlwPeAy8xsCvAPQAFw4Hkz63T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tAH7u7v2RdfeGH0+Y2Y+BrzUyrrCpBnffY2ZbgIXAv9Lk/WVmZwO/BL4RnmYX1z3i/RWj0vclrk63mZ0JTCRoHqhl2XrGhZldRZBsP+buJ4rlFf6maRzoqsbl7ocik/9M8Az44rKLypbdkkJMNcUVsRK4KVpQx/1VTaW467KvxnJTUjOeE9EZrq+W9Q5q2wwPjsV2/eVAbA+GesRlZpOLTTFmNg24HHi52fsr/Nv9nKD99Wdl89LcX7HflyHivRZ4Otw/ncBKC3otzQXmAf+eIJZhxWVmC4EfANe4+4FIeezftIFxzYhMXkMwLD8EZ8mfCOObDHyC0jPnusYVxjaf4GLu7yJl9dxf1XQCXwx7J30EOBr+8KnPvqrHFfZmv4C/JsikJ4D9wKawfCbwRKTep4A/EGT82yPlFxD8x90N/AyYkFJcU4HNwK7wfUpYXgB+GKk3B9gHnFG2/NPADoID3P8C3tOouICPhtv+ffh+Qxb2F/AFoB/YFnl11GN/xX1fCJqmrgk/t4b//t3h/rggsuzt4XI7gU+m/H2vFtdT4f+D4v7prPY3bVBc3wJeCrf/DPCByLL/NdyPu4EvNTKucPpOYF3ZcnXbXwQ/AnvD73I3wbWgLwNfDucbcF8Y8w4ivS3rsa9057OIiJQYy01JIiISQ4lBRERKKDGIiEgJJQYRESmhxCAiIiWUGEREpIQSg4iIlFBiEBGREv8f5f81lj/vM5sAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "####(c)\n",
    "clf = Perceptron()\n",
    "clf.fit(X, y)\n",
    "\n",
    "w1 = clf.coef_[0]\n",
    "b1 = clf.intercept_[0]\n",
    "\n",
    "#作图\n",
    "m1 = np.array([-1, 1])\n",
    "n1 = - (b + w[0] * m1) / w[1]\n",
    "plt.scatter(x1[y>0], x2[y>0], label=\"+\")\n",
    "plt.scatter(x1[y<0], x2[y<0], label=\"-\")\n",
    "plt.plot(m1, n1, 'r')\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAFV1JREFUeJzt3X+MXeWd3/H3NzbYYaGxsQeEPIZxgrM1CcGAm7CN+LGBQky2MVFxbKcNhjhy1dKIhEaNaaStGjUK+adJiSqotWwZImKbH03tELJbYvJDVTDBEK/5YSgT6sUjT7ExvwIOWbz+9o95xoztsefOzL2+Mw/vl3R1z3nOc+79nsfDZw7PPfdMZCaSpHq9p90FSJJay6CXpMoZ9JJUOYNekipn0EtS5Qx6SaqcQS9JlTPoJalyBr0kVW5yuwsAmDlzZnZ1dbW7DEmaUB577LGXMrNjuH7jIui7urrYvHlzu8uQpAklIv62kX5O3UhS5Qx6SaqcQS9JlRsXc/SSNFpvv/02vb29vPXWW+0upWWmTp1KZ2cnxx133Kj2N+glTWi9vb2cdNJJdHV1ERHtLqfpMpM9e/bQ29vLnDlzRvUaTt1ImtDeeustZsyYUWXIA0QEM2bMGNP/sRj0kia8WkN+wFiPz6CXpMoZ9JLUBN/85jf50Ic+xEc+8hHmz5/PwoULuemmmw7qs2XLFubNmwf0f1H0wgsvPGj7/Pnz+fCHP9z02ib8h7Fdq37ctvfefvOn2vbeksaPhx9+mPvvv5/HH3+cKVOm8NJLL/HUU09x3XXX8a1vfetAv7Vr1/K5z33uwPrvfvc7duzYwezZs9m2bVvL6vOMXpLGqK+vj5kzZzJlyhQAZs6cycUXX8y0adN45JFHDvS7++67Wbp06YH1z372s6xbtw6ANWvWsGzZspbUN+HP6CXpgC9/GbZsae5rzp8P3/3uU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lTPoJalyBr0kVc6gl6TK/X+tZUXqMF05CwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#多次实验，做直方图\n",
    "result = np.array([])\n",
    "for i in range(2000):\n",
    "    np.random.shuffle(X)\n",
    "    y = np.sign(X[:,1])\n",
    "    clf.fit(X, y)\n",
    "    w1 = clf.coef_[0]\n",
    "    b1 = clf.intercept_[0]\n",
    "    result = np.append(result,Eout(w1,b1))\n",
    "    \n",
    "plt.hist(result, label=\"PLA\")\n",
    "plt.plot([e] * 400, range(400), 'r', label=\"SVM\")\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Exercise 8.17 (Page 45)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xl8VOW9x/HPLyEhBJAl7IRFFpVF1rDbXpVq1VZZBAEtoKCA2Kv2dtPaa9XWWm1drgooIAqogCJYaEHrgtWyB2UHFVE0goAgQWTH5/4xZ3QcJ8kkmT3f9+s1LyZznpzz4xB+eXLmyfmacw4REUktafEuQEREIk/NXUQkBam5i4ikIDV3EZEUpOYuIpKC1NxFRFKQmruISApSc5eUYWbtzexlM/vczIr9BQ4z22pmo0K8fpOZ5XvP25nZv8zsCzM7YGZrzOySMtRVz8xmmdlOMys0s6Vm1qO0+xEpDTV3SSUngOeA0WGMnQ6MCPH6cG8bwELgFaA+UA+4EThYhrqqAau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5ztt3M3sA364l0cy9N+HuBxS78vcS6nHP7Aj6cgu+9qHiLytdTJAQ2VefcIjObaGZ1nHNRvamYmWXga+zPOOfmhRgStXOWFJdlzOwi4LfAZc65w0UMCyfIO+bMrKqZVfc/x/fmcMh39OMgHucsMEx9JPC9nzDMrJaZVfae1wH6AJujUEuihr+XWFfQddnL8F3PjbcFwAhvBUhPoNB/CS7ezKyB/70SM+uOr/ftK/6zyn1Mw5cvvcU590ARw6J3zmL57nE53nXehu+61Frv4V+90AhYFPTO83v4Zni3xaCuAfi+8x4DdgMvB9eFb8XDOu+xKRZ1hVtbnM5ZDvAa8L73Z23v9Txgqve8N7DBO2cbgNFRrOd7f3/gLnwTCYAs4Hnva3AV0CJG/34l1XWP9/W0DlgCnBWDmmYBu4AT3tfWaGAcMM7bbsAEr+YNFLOCLA61/TzgfK0AesegpnPwXWJZH9C7LonVOdPtB0REUlBSXJYREZHSUXMXEUlBau4iIilIzV1EJAWpuYuIpCA1dxGRFKTmLiKSgv4f/X86iurV4bUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "\n",
    "def e1(t):\n",
    "    return max(1 - t, 0)\n",
    "\n",
    "def e2(t):\n",
    "    if t >= 0:\n",
    "        return 0\n",
    "    else:\n",
    "        return 1\n",
    "    \n",
    "x = np.arange(-2, 2, 0.01)\n",
    "y1 = [e1(i) for i in x]\n",
    "y2 = [e2(i) for i in x]\n",
    "\n",
    "plt.plot(x, y1, label='e1')\n",
    "plt.plot(x, y2, label='e2')\n",
    "plt.legend()\n",
    "plt.title('e1 VS e2')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Problem 8.5 (Page 47)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs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P054hYcg2F6Z1bVfoDm/r2TO1TV9+jP+7S/uW2uqufmtcrZm3ZcwC8BB5M8kuTpJHc1fxUtZNOOK8kvAP8ZuGWea+tiJu/XzyW5lP4fKj+ah9pma6qp+If2aabVeZX+tDkL2UzGNegm4NvHtKI56voLbseFo00tPsPtPwhcyDvp/1iSX6+q/zmiEuek67jo//v4NeAS4CfAg8CNjHlOqxGM6/eAv66qFxbSH6EjGNeR5zkL+CqwvqreHkVtIzaTKfdnNS3/AjHjmpN8AuixQA85GwwcfWrxJC8lOauq9jf/4YYdY/8t4Kmq+lmzzbeBfw6MNRhGMK69wNNV9XyzzaP0xzXWYBjBuH4V+LUkvwf8IrA0yc+q6mjnI465EYyLJO8GvgX8QVU9dYxK7WqqqfiH9dmb5CTgVOCV+SlvzmYyLpJcQT/sP1pVr89TbbPioaTpbaI/JThMPTX4T4CPJjkpycn0/wpY6IeSZjKurcDyJEeOU18G7JyH2rqYdlxV9e+qalVVrQY+DXxl3KEwA9OOq5nW/uv0x/O1eaxttoZOxT+pz+B4rwWeqIX/patpx5XkEuA+4OqqWrgXclSVt6Pc6B/X3ALsbu5Pb9p7wBeax0vov9nP0f/g/C/jrnsU42qW1wLbgR3Al4Gl4659FOMa6H8j8GfjrnsU4wI+ARwGnhm4rRl37VOM518BP6R/DuT2pu0O+h+Y0L+Y42vAHuBvgQ+Mu+YRjetx+hemHHl/No275mE3v/ksSWrxUJIkqcVgkCS1GAySpBaDQZLUYjBIkloMBklSi8EgSWoxGCRJLf8frQhN82BmVfAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "####a,b\n",
    "def generate(n=3):\n",
    "    \"\"\"\n",
    "    生成n个点\n",
    "    \"\"\"\n",
    "    X1p = np.random.uniform(-1, 1, n)\n",
    "    X2p = np.random.uniform(0, 1, n)\n",
    "    X1n = np.random.uniform(-1, 1, n)\n",
    "    X2n = np.random.uniform(-1, 0, n)\n",
    "\n",
    "    return X1p, X2p, X1n, X2n\n",
    "\n",
    "#生成数据\n",
    "X1p, X2p, X1n, X2n = generate()\n",
    "plt.scatter(X1p, X2p)\n",
    "plt.scatter(X1n, X2n)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAD8CAYAAABzTgP2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAHHdJREFUeJzt3X2QVPWd7/H3h8nwEDQ8CElARGAvIQooYIu51ySQoELWKOi6ihtr4V4t86Cbqk3JBSoPJN5NFhcrWKmLSYhR2GyiolEyFiFcULnRulEZ1IBgCATdOAxRAoIVHRHwe//oM6TP2PN4eqbn4fOq6uo+v/M753znNz39mXNO92lFBGZmZvV6lbsAMzPrXBwMZmaW4mAwM7MUB4OZmaU4GMzMLMXBYGZmKQ4GMzNLcTCYmVmKg8HMzFLeV+4C2mLIkCExatSocpdhZtalbN269c8RMbS5fl0yGEaNGkV1dXW5yzAz61Ik/WdL+vlQkpmZpTgYzMwsxcFgZmYpDgYzM0txMJiZWYqDwczMUhwMZmaW0iU/x2DWWmuf28eyDbuoPVzH8IH9WDBzHHMmn17ustpNT/t5rbQcDNbtrX1uH4sf2k7dsRMA7Dtcx+KHtgN0yxfLnvbzWun5UJJ1e8s27Dr5Ilmv7tgJlm3YVaaK2ldP+3mt9BwM1u3VHq5rVXtX19N+Xis9B4N1e8MH9mtVe1fX035eKz0Hg3V7C2aOo19lRaqtX2UFC2aOK1NF7aun/bxWej75bN1e/QnXnvIunZ7281rpKSLKXUOr5XK58GW3zcxaR9LWiMg118+HkszMLMXBYGZmKQ4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ePIn8z9TUFbe45Xc6qAf0zenfQx4Ejyj0/7jFV7nGEv9w24gnySHgVeBTYk7cOBXxb0+1vg9+QT/6sF7WPI/+HuAR4A+pSortOAR4Hdyf3gpD0H3FXQbxSwD+jVYPnHgO3kX+D+Azilo+oC/luy7d8m99d3hvECrgOOAc8X3Ca1x3gVe76QPzR1efK4b/Lz70nGY0zBsl9NltsFfKbEz/fm6tqU/B3Uj09Vc7/TDqrrX4EdyfYfBz5asOz/SMZxD/DfO7KuZPqbwNIGy7XbeJH/J3B/8lyuIX8u6AvAF5L5AlYkNW+n4N2W7TFW/uSzmZml9ORDSWZmVoSDwczMUhwMZmaW4mAwM7MUB4OZmaU4GMzMLMXBYGZmKQ4GMzNL+f86Qy3P2c8AaAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a_random = 0.3897481680806236\n",
      "a_svm = 0.1437049653382313\n"
     ]
    }
   ],
   "source": [
    "#产生结果\n",
    "def mysvm(X2p, X2n):\n",
    "    \"\"\"找到+1类中纵坐标最小的点，-1类中纵坐标最大的点\"\"\"\n",
    "    return (np.min(X2p) + np.max(X2n)) / 2\n",
    "\n",
    "a_random = np.random.uniform(-1, 1)\n",
    "a_svm = mysvm(X2p, X2n)\n",
    "\n",
    "plt.scatter(X1p, X2p, label=\"+\")\n",
    "plt.scatter(X1n, X2n, label=\"-\")\n",
    "plt.plot([-1, 1], [a_random, a_random], label=\"random\")\n",
    "plt.plot([-1, 1], [a_svm, a_svm], label=\"svm\")\n",
    "plt.legend()\n",
    "plt.show()\n",
    "\n",
    "print(\"a_random = {}\".format(a_random))\n",
    "print(\"a_svm = {}\".format(a_svm))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUg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11FO7x5133nkAnHzyyWzduhWABx98kIsuugiAs846i7FjxwLw8MMPc+6553LooYcyZswYzjvvPB566CEApkyZwowZMxgxYgTTpk3jtNNOIyKYMWPG7uX2J485SFILDj30UACee+45rrnmGh577DHGjh3LokWL/uz7BYcccggAI0eOZNeuXbvrjU41rd+9tKfu5QCMGDFi9+MRI0b82XL7i+Eg9bdWD2SDB7OHoddee41DDz2Uww8/nBdffJG7776buXPn7nWe97///Xz/+9/nqquu4u677+aVV17ZXV+0aBFLly4lM7njjjv43ve+NwivospwkDSstePU03onnngiM2fOZNq0aRx33HGccsopvc6zbNkyLrzwQmbNmsWpp57KscceC8CsWbNYtGgRs2fPBuCSSy5h5syZA7LbqDext82YoayjoyP9z340oPqyBdDyc7rl0JvNmzdz/PHHt7uNYaHRuoqI9ZnZ0du8HpCWJFUYDpKkCsNBklRhOEiSKnoNh4g4JiLuj4jNEbEpIj5f6ldHxG8i4vFyO7NunisiojMinomI0+vq80utMyKW1tWnRMQjEbElIm6LiIP7+4VKkprXzJbDLuBvM/N4YA5wWUScUKZ9KzNPKrfVAGXaBcA0YD7wDxExMiJGAtcDZwAnABfWLecbZVlTgVeAxf30+iRJLej1ew6ZuR3YXu7/PiI2A0fvZZYFwK2Z+SbwXER0ArPLtM7MfBYgIm4FFpTlfRD4RBmzErgauGHfX46kA05/n3Ls6cTAPh5ziIjJwEzgkVL6XERsjIjlETG21I4GXqibravUeqofCfwuM3ftUW/0/EsiYl1ErHv55Zf3pXVJ0j5oOhwiYgzwI+BvMvM1an/Z/yVwErUti292D20we7ZQrxYzb8zMjszsmDBhQrOtS1K/ef311znrrLM48cQTmT59OitXruTjH//47ukPPPAAH/nIRwAYM2YMl19+OSeffDIf+tCHePTRR5k7dy7HHXccq1atatdLaEpT4RARo6gFw/cz858BMvPFzHwrM/8E3MS/7TrqAo6pm30SsG0v9d8CR0TEQXvUJWnI+clPfsJRRx3FL3/5S5588knOOecc1q5dy+uvvw7Abbfdxvnnnw/UgmTu3LmsX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ijgN+GhFPAK81GNeu9fU9YGFm/qmUW15fjZ6iQW3P1zkgn6leNL3siLgI6ABOrStX3tPM/HWj+Qegrx8DP8jMNyPiM9S2uj7Y5LwD2Ve3C4AfZuZbdbWBWl+9GdTP1rAOh8z8UB8X0dNlO35LbZPtoPLXX8PLebTSV0S8GBETM3N7+WX20l4W9XHgjsz8Y92yt5e7b0bEd4H/Oph9ld02ZOazEfEAMBP4EW1eXxHxNuAu4Kqyyd297JbXVwPNXOale0xXRBwEHE5tV0FTl4gZwL6IiA9RC9xTM/PN7noP72l//LLrta/M3FH38CbgG3Xzzt1j3gf6oaem+qpzAXBZfWEA11dveup7QNbVgb5bqeFlO7J2lOd+avv7ARYCzWyJNGNVWV4zy63s6yy/ILv3858DNDyzYSD6ioix3btlImI8cArwVLvXV3nv7qC2P/af9pjWn+urmcu81Pf7UeCnZf2sAi6I2tlMU4CpwKN96GWf+oqImcD/BM7OzJfq6g3f00Hsa2Ldw7OBzeX+PcC80t9YYB5/vgU9oH2V3v6K2gHen9fVBnJ99WYVcHE5a2kO8Gr542dg1tVAHHUfCjfgXGqJ+ibwInBPqR8FrK4bdybwK2rJf2Vd/Thq/3g7gX8CDumnvo4E7gO2lJ/jSr0D+F914yYDvwFG7DH/T4EnqP2S+9/AmMHqC/gP5bl/WX4uHgrrC7gI+CPweN3tpIFYX40+L9R2U51d7o8ur7+zrI/j6ua9ssz3DHBGP3/ee+vr3vLvoHv9rOrtPR2kvv4bsKk8//3Au+vm/U9lPXYCnxrMvsrjq4Gv7zHfgK0van8Ibi+f5S5qx4Y+A3ymTA9q/ynar8tzd9TN2+/rym9IS5IqDvTdSpKkBgwHSVKF4SBJqjAcJEkVhoMkqcJwkCRVGA6SpArDQZJU8f8B8UI/AcsVs3MAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "####c,d\n",
    "N = 100000\n",
    "A_random = []\n",
    "A_svm = []\n",
    "for i in range(N):\n",
    "    X1p, X2p, X1n, X2n = generate()\n",
    "    a_random = np.random.uniform(-1, 1)\n",
    "    a_svm = mysvm(X2p, X2n)\n",
    "    A_random.append(a_random)\n",
    "    A_svm.append(a_svm)\n",
    "\n",
    "#画直方图\n",
    "plt.hist(A_random, label='random')\n",
    "plt.hist(A_svm, label='svm')\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "bias_random = 0.00038\n",
      "bias_svm = 1e-05\n"
     ]
    }
   ],
   "source": [
    "####e\n",
    "#计算a_random_mean,a_svm_mean\n",
    "#根据之前模拟的结果得到随机选择以及svm算法对应的系数\n",
    "A_random = np.array(A_random)\n",
    "A_svm = np.array(A_svm)\n",
    "a_random_mean = np.mean(A_random)\n",
    "a_svm_mean = np.mean(A_svm)\n",
    "#生成用于模拟的数据\n",
    "X2 = np.random.uniform(-1, 1, 100000)\n",
    "#计算标签\n",
    "Y = np.sign(X2)\n",
    "Y_random_mean = np.sign(X2 - a_random_mean)\n",
    "Y_svm_mean = np.sign(X2 - a_svm_mean)\n",
    "#计算平均值\n",
    "bias_random = np.mean(Y != Y_random_mean)\n",
    "bias_svm = np.mean(Y != Y_svm_mean)\n",
    "print(\"bias_random = {}\".format(bias_random))\n",
    "print(\"bias_svm = {}\".format(bias_svm))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "var_svm = 0.05110900000000001\n",
      "var_random = 0.250094\n"
     ]
    }
   ],
   "source": [
    "#计算var_random_mean,var_svm\n",
    "var_random = np.array([])\n",
    "var_svm = np.array([])\n",
    "for i in range(1000):\n",
    "    #生成数据\n",
    "    X1p, X2p, X1n, X2n = generate()\n",
    "    #计算随机选择以及svm算法对应的系数\n",
    "    a_random = np.random.uniform(-1, 1)\n",
    "    a_svm = mysvm(X2p, X2n)\n",
    "    #生成用于模拟的数据\n",
    "    X2 = np.random.uniform(-1, 1, 1000)\n",
    "    #计算标签\n",
    "    Y_random = np.sign(X2 - a_random)\n",
    "    Y_svm = np.sign(X2 - a_svm)\n",
    "    #计算平均值\n",
    "    Y_random_mean = np.sign(X2 - a_random_mean)\n",
    "    Y_svm_mean = np.sign(X2 - a_svm_mean)\n",
    "    #计算样本方差\n",
    "    var_random = np.append(var_random, np.mean(Y_random_mean != Y_random))\n",
    "    var_svm = np.append(var_svm, np.mean(Y_svm_mean != Y_svm))\n",
    "    \n",
    "print(\"var_svm = {}\".format(np.mean(var_svm)))\n",
    "print(\"var_random = {}\".format(np.mean(var_random)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Problem 8.13 (Page 50)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAD8CAYAAABzTgP2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAGbVJREFUeJzt3X+sXOV95/H3p8Y2XlWxTewkxvaNjdZLQxNktyOaXaSm4ZedqsHelLpmFcW0RFayoUiNgmJElCA3UUz5w1tUNolLHJxsBTg0IRclkdfYsJF2Q8p4ITYQGRtnWa6vg92CXa24JcZ894/zDD7neubemTvnzsy983lJoznneZ4z873n3jvfOc9zznkUEZiZmdX8RrcDMDOz3uLEYGZmBU4MZmZW4MRgZmYFTgxmZlbgxGBmZgVODGZmVuDEYGZmBU4MZmZWcEEZLyJpB/BHwImIeH+degF/A/wh8DpwU0T871S3EfhCavrliNg53vstWLAgli1bVkboZmZ9Y//+/f8UEQvH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gn6SDwL3XaTegUtpL35XeAjRHxVioubV+Ofrs6ZaN//lImoWpD0+8j6eNABfhQrvi833tEvFhv+0mO8VHggYh4Q9KnyI7Crmpy2zK08j4bgIcj4myurBP7sRml/T06MTQQY0xQJOkVSYsi4nj6sDoxxkutB74fEWdyr308Lb4h6VvA57oZZ+qeISKOSnoCWAX8Ay1MpDTZMUp6B/BD4AvpMLn22qXty1EaTTBVr82QpAuAuWSH+s1s26kYkXQNWRL+UES8UStv8Hsv+wNt3Bgj4p9zq38H3JXb9g9GbftEyfHV3qfZ39cG4DP5gg7tx2Y0+jla3o/uSpqYQbKJhWD8CYbO649MH4C1fvx1QN2zDEowbpyS5te6XyQtAK4Eno9s1KoTEyk1E+Ms4Ptk/affHVU3Wfuy7gRTY8R+A7Av7bdBYIOys5aWAyuAfywprpZilLQK+AZwfUScyJXX/b13KcZFudXryeZtgewo+7oU63zgOopH3h2LMcV5Kdng7U9zZZ3aj80YBD6Rzk76IHA6fXFqfT92YjR9uj3I+pH3AofT80WpvALcl2u3DDgG/Mao7fcBB8k+xP4b8JvdihP4DymWn6fnm3PbX0L2gXYE+C4wu0sxfhw4AzyTe6yc7H1JdpbHC2Tf/u5IZVvIPmQBLkz75UjaT5fktr0jbXcI+Mgk/i2OF+NjwCu5/TY43u+9CzF+FXguxfI48Fu5bf887d8jwJ91K8a0fiewddR2ndyPD5CdkXeG7CjgZuBTwKdSvYB7089wEKhMdD/6ymczMytwV5KZmRU4MZiZWYETg5mZFTgxmJlZgRODmZkVODGYmVmBE4OZmRU4MZiZWcH/B9Slk4B26breAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "from sklearn import svm\n",
    "from sklearn.preprocessing import PolynomialFeatures\n",
    "import matplotlib.pyplot as plt\n",
    "from numpy.linalg import inv\n",
    "\n",
    "####(a)\n",
    "#题目中的数据\n",
    "X = np.array([(-0.494, 0.363), (-0.311, -0.101), (-0.0064, 0.374), (-0.0089, -0.173),\n",
    "              (0.0014, 0.138), (-0.189, 0.718), (0.085, 0.32208), (0.171, -0.302), (0.142, 0.568),\n",
    "              (0.491, 0.920), (-0.892, -0.946), (-0.721, -0.710), (0.519, -0.715),\n",
    "              (-0.775, 0.551), (-0.646, 0.773), (-0.803, 0.878), (0.944, 0.801),\n",
    "              (0.724, -0.795), (-0.748, -0.853), (-0.635, -0.905)])\n",
    "#对应标签\n",
    "y = np.array([1] * 9 + [-1] * 11)\n",
    "\n",
    "#作图\n",
    "x1p = X[y>0][:,0]\n",
    "x2p = X[y>0][:,1]\n",
    "x1n = X[y<0][:,0]\n",
    "x2n = X[y<0][:,1]\n",
    "\n",
    "plt.scatter(x1p, x2p)\n",
    "plt.scatter(x1n, x2n)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEJCAYAAABohnsfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xl8VPW9//HXJyshAbJCQhKWkLAvASKCqCCLIFY2AXGrSy1tb7W37b3eau2tlrZXW3+9tt7aVtta3BFREBQFBHFhk7CvWQhbFiBkA0IIWb6/P+ZER0wgYSZzZiaf5+Mxj5k5y8ybw2Q+c873fL9HjDEopZRSzRFgdwCllFK+Q4uGUkqpZtOioZRSqtm0aCillGo2LRpKKaWaTYuGUkqpZtOioZRSqtm0aCjlIhHJF5Eb7M6hlCdo0VDqCohIRxF5RkSOA4nA+yKyUkSG2Z1NqdakRUOpFhIRAd4DrgZuAAqA24FNwOciMsjGeEq1Ki0aSrXcNcB1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29ZZVCOBCutHVsu3p6da91t6A2bgqILVwAlgpTW9K7DCabkpQDaOCv6Y0/QUHH+YucBbQGgrZIwB1gA51n20NT0D+IfTcj2AAiDgovXXArtxfLm9CkS00ra8bE7gGivLTuv+O57cli3IeRdQA+xwuqV7Yns29lnDcfhrqvW4nbV9cq3tleK07mPWelnATa38t3O5nB9Zf1MN22/Z5T4DNmR8EthrZfkY6Ou07v3WNs4F7rNzW1rPnwCeumg9j21L6/3ewHEmYQ2O783vAN8Hvm/NFxwXwzto5clwWrdF21OHEVFKKdVsvn54SimllAdp0VBKKdVsWjSUUko1mxYNpZRSzaZFQymlVLNp0VBKKdVsWjSUUko12/8HwYKp3B4HHFEAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#二次转换\n",
    "def contour(X1, X2, clf, poly):\n",
    "    \"\"\"\n",
    "    计算每个点的标签\n",
    "    \"\"\"\n",
    "    X = np.c_[X1.ravel(), X2.ravel()]\n",
    "    X_poly = poly.fit_transform(X)\n",
    "    label = clf.predict(X_poly)\n",
    "    label = label.reshape(X1.shape)\n",
    "    \n",
    "    return label\n",
    "\n",
    "poly2 = PolynomialFeatures(2)\n",
    "X_poly2 = poly2.fit_transform(X)\n",
    "\n",
    "clf = svm.SVC(kernel=\"linear\", C=1e10)\n",
    "clf.fit(X_poly2, y)\n",
    "\n",
    "#点的数量\n",
    "n = 1000\n",
    "r = 1\n",
    "\n",
    "#作点\n",
    "a = np.linspace(-r, r, n)\n",
    "b = np.linspace(-r, r, n)\n",
    "\n",
    "#构造网格\n",
    "A, B = np.meshgrid(a, b)\n",
    "C = contour(A, B, clf, poly2)\n",
    "\n",
    "#绘制等高线\n",
    "plt.contour(A, B, C, 0)\n",
    "plt.scatter(x1p, x2p)\n",
    "plt.scatter(x1n, x2n)\n",
    "plt.title('$\\Phi_2$')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEJCAYAAABohnsfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xl8VPW9//HXJyEbhOxANpYACYssASIKKMgmuAFuCG5obf11sd5fvfVWf+1Vr63V1ntr21tbazfcAVEREURkUakgWwIBJAt7VrKShOzJ9/fHTOiICUmYyZyZ5PN8PPLIzPecM/P2OOQz53y/53vEGINSSinVET5WB1BKKeU9tGgopZTqMC0aSimlOkyLhlJKqQ7ToqGUUqrDtGgopZTqMC0aSimlOkyLhlJOEpEcEZlpdQ6l3EGLhlKXQERCROQFESkA4oAPRWSjiEy0OptSXUmLhlKdJCICrAOuAGYCucBSYCewXUTGWhhPqS6lRUOpzpsKXA0sNsZ8ZW87a4x5EvgC+KFlyZTqYr2sDqCUFxoMFBtjclpZlgqMF5EBwHtAA9AE3GWMyXdjRqW6hB5pKNV5J4FIEYlpZdk44ARQDFxljJkBvAo84L54SnUdLRpKdd4XwD+BFSIy1N7WR0QeB64Cfm+MaTLGNNuX9QUOWZBTKZfToqFUJxnb/QRuwHYq6gtso6feBq4BphljDgKISLKIfAk8BOyzJq1SriV6Pw2lnCMiOcA9xpitbSxfDMwyxnzXvcmUcj3tCFfKScaY+AvbRCTAGFNnf3oWqHZvKqW6hhYNpbrGRBH5FbaRU7XAtyzOo5RL6OkppZRSHeaSjnAR+buInBGRg20sFxH5vYhki8gBx6kWRGSZiGTZf5a5Io9SSqmu4arRU8uB+RdZfh2QaP95EPgTgIhEAE9im45hMvCkiIS7KJNSSikXc0nRMMZ8BpReZJWFwKvGZicQZr8wah6wyRhTaowpAzZx8eKjlFLKQu7qCI8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FDANOOzGfdnRnP7Ae9jOz759wbKu3J+tftYukv82YIt9/60FlohtdFUCkAjscmG2TuUUkQnY7oGzwBhzxqG91c+ARRljHJ4uwDabBNiO1K+1Zw0HruXrR+9uzWnPOgJbJ/IOhzZ37cuOWgvcax9FdSVw1v4lq/P70129+539AW7GVgXrgEJgo709FljvsN71QCa2Cv5Th/ah2P5hZgNvAwFdkDES2Axk2X9H2NtTgL86rDcEyAV8Lth+C5CO7Y/b60BwF+3LdnMCU+1Z9tt/P+DOfdmJnHcDDUCaw0+yO/Zna581bKe/FtgfB9r3T7Z9fw112Pan9u0ygOu6+N9Oezk/sf+batl/a9v7DFiQ8VngkD3LVmCkw7bfsu/jbOB+K/el/flTwHMXbOe2fWl/v7ewjSRswPZ38wHgu8B37csF283wjtrzpDhs26n9qdOIKKWU6jBvPz2llFLKjbRoKKWU6jAtGkoppTpMi4ZSSqkO06KhlFKqw7RoKKWU6jAtGkoppTrs/wOAdQCYde/d7gAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#三次转换\n",
    "poly3 = PolynomialFeatures(3)\n",
    "X_poly3 = poly3.fit_transform(X)\n",
    "\n",
    "clf = svm.SVC(kernel=\"linear\", C=1e10)\n",
    "clf.fit(X_poly3, y)\n",
    "\n",
    "#构造网格\n",
    "A, B = np.meshgrid(a, b)\n",
    "C = contour(A, B, clf, poly3)\n",
    "\n",
    "#绘制等高线\n",
    "plt.contour(A, B, C, 0)\n",
    "plt.scatter(x1p, x2p)\n",
    "plt.scatter(x1n, x2n)\n",
    "plt.title('$\\Phi_3$')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEJCAYAAABohnsfAAAABHNCSVQICAgIfAhkiAAAAAlwS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kp1mCYNpZRSHaZJQymlVIdp0lBKKdVhmjSUUkp12P8H3UcRyjeG5NcAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "####(c)\n",
    "Lambda = 1\n",
    "n, d = X_poly3.shape\n",
    "w = inv(X_poly3.T.dot(X_poly3) + Lambda * np.eye(d)).dot(X_poly3.T.dot(y))\n",
    "\n",
    "label = poly3.fit_transform(np.c_[A.ravel(), B.ravel()]).dot(w)\n",
    "C = label.reshape(A.shape)\n",
    "\n",
    "plt.contour(A, B, C, 0)\n",
    "plt.scatter(x1p, x2p)\n",
    "plt.scatter(x1n, x2n)\n",
    "plt.title('$\\Phi_3$')\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
